package com.apotik.legenda.model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Type;


@Entity
@Table(name="apt_employee_debt")
public class EmployeeDebt implements Serializable {
private static final long serialVersionUID = 3448025803207298346L;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="debt_id")
	private Long debtId;
	
	@Column(name="transaction_code", unique = true, length = 30, nullable = false)
	private String transactionCode;
	
	@Column(name="transaction_date", nullable = false)
	@Temporal(TemporalType.TIMESTAMP)
	private Date transactionDate;
	
	@ManyToOne
	@JoinColumn(name="user_id_input", referencedColumnName = "user_id", nullable = false)
	private User userIdInput;
	
	@ManyToOne
	@JoinColumn(name="user_id_debt", referencedColumnName = "user_id", nullable = false)
	private User userIdDebt;
	
	@Column(name="updated_date")
	@Temporal(TemporalType.TIMESTAMP)
	private Date updatedDate;
	
	@Column(name="discount_total", nullable = false)
	private BigDecimal discountTotal = BigDecimal.ZERO;
	
	@Column(name="payment_total", nullable = false)
	private BigDecimal paymentTotal = BigDecimal.ZERO;
	
	@Column(name="service_fee_total", nullable = false)
	private BigDecimal serviceFeeTotal = BigDecimal.ZERO;
	
	@Column(name="refund_total", nullable = false)
	private BigDecimal refundTotal = BigDecimal.ZERO;
	
	@Column(name="notes")
	@Type(type="text")
	private String notes;
	
	

	public Long getDebtId() {
		return debtId;
	}

	public void setDebtId(Long debtId) {
		this.debtId = debtId;
	}

	public String getTransactionCode() {
		return transactionCode;
	}

	public void setTransactionCode(String transactionCode) {
		this.transactionCode = transactionCode;
	}

	public Date getTransactionDate() {
		return transactionDate;
	}

	public void setTransactionDate(Date transactionDate) {
		this.transactionDate = transactionDate;
	}

	public User getUserIdInput() {
		return userIdInput;
	}

	public void setUserIdInput(User userIdInput) {
		this.userIdInput = userIdInput;
	}

	public User getUserIdDebt() {
		return userIdDebt;
	}

	public void setUserIdDebt(User userIdDebt) {
		this.userIdDebt = userIdDebt;
	}

	public Date getUpdatedDate() {
		return updatedDate;
	}

	public void setUpdatedDate(Date updateDate) {
		this.updatedDate = updateDate;
	}

	public BigDecimal getDiscountTotal() {
		return discountTotal;
	}

	public void setDiscountTotal(BigDecimal discountTotal) {
		this.discountTotal = discountTotal;
	}

	public BigDecimal getPaymentTotal() {
		return paymentTotal;
	}

	public void setPaymentTotal(BigDecimal paymentTotal) {
		this.paymentTotal = paymentTotal;
	}

	public BigDecimal getServiceFeeTotal() {
		return serviceFeeTotal;
	}

	public void setServiceFeeTotal(BigDecimal serviceFeeTotal) {
		this.serviceFeeTotal = serviceFeeTotal;
	}

	public BigDecimal getRefundTotal() {
		return refundTotal;
	}

	public void setRefundTotal(BigDecimal refundTotal) {
		this.refundTotal = refundTotal;
	}

	public String getNotes() {
		return notes;
	}

	public void setNotes(String notes) {
		this.notes = notes;
	}

}
